package org.springblade.modules.platform.vo.enums;

import java.util.HashMap;
import java.util.Map;

public enum  NetworkTypeEnum {

	UDP(1,"UTP"),
	HTTPCLIENT(2,"HTTP客户端"),
	WEBSOCKETSERVICE(3,"WebSocket服务"),
	TCPSERVICE(4,"TCP服务"),
	MQTTCLIENT(5,"MQTT客户端"),
	COAPCLIENT(6,"CoAp客户端"),
	HTTPSERVICE(7,"HTTP服务"),
	MQTTSERVICE(8,"MQTT服务"),
	WEBSOCKETCLIENT(9,"WebSocket客户端"),
	COAPSERVICE(10,"CoAp服务"),
	TCPCLIENT(11,"TCP客户端");



	private Integer code;
	private String msg;

	private static Map<Integer, NetworkTypeEnum> valueMap;

	static {
		valueMap = new HashMap<>();
		for (NetworkTypeEnum e : values()){
			valueMap.put(e.code, e);
		}
	}
	NetworkTypeEnum(int code, String msg){
		this.code = code;
		this.msg = msg;
	}
	public static NetworkTypeEnum getEnum(int key) {
		if (!valueMap.containsKey(key)) {
			return null;
		}
		return valueMap.get(key);
	}

	public Integer getCode() {
		return code;
	}

	public void setCode(Integer code) {
		this.code = code;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}
}
